<?php 
/* header("Pragma: public");
header("Expires: 0");
header("Accept-Ranges: bytes");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/vnd.ms-excel");
header('Content-Disposition: attachment; filename=megaspravka.xls');
header("Content-Transfer-Encoding: binary"); */

?>
<h1>Бюджет</h1>
<table width="100%" border="1" cellspacing="2" cellpadding="2">
  <tr>
    <td>&nbsp;</td>
    <td align="center"><strong>подано</strong></td>
    <td align="center"><strong>двойки</strong></td>
    <td align="center"><strong>н я</strong></td>
    <td align="center"><strong>зачислено</strong></td>
  </tr>
  <tr>
    <td width="33%"><p>полное общее оразование <strong>ранее 2009</strong></p></td>
    <td width="33%"><?php  echo $p_b_low_edu ;?></td>
    <td width="33%">&nbsp;</td>
    <td><?php  echo $neyavka2009 ;?></td>
    <td><?php  echo $b_low_edu ;?></td>
  </tr>
  <tr>
    <td width="33%"><p>среднее образование</p></td>
    <td width="33%"><?php  echo $p_b_middle_edu ;?></td>
    <td width="33%">&nbsp;</td>
    <td><?php echo $neyavka_middle_edu; ?></td>
    <td><?php  echo $b_middle_edu ;?></td>    
  </tr>
</table>
<p>&nbsp;</p>
<h1>ВнеБюджет </h1>
<table width="100%" border="1" cellspacing="2" cellpadding="2">
  <tr>
    <td>&nbsp;</td>
    <td align="center"><strong>подано</strong></td>
    <td align="center"><strong>двойки</strong></td>
    <td align="center"><strong>н я</strong></td>    
    <td align="center"><strong>зачислено</strong></td>
  </tr>
  <tr>
    <td width="33%"><p>полное общее оразование <strong>ранее 2009</strong></p></td>
    <td width="33%"><?php  echo $p_vb_low_edu ;?></td>
    <td width="33%">&nbsp;</td>
    <td><?php  echo $vbneyavka2009 ;?></td>
    <td><?php  echo $vb_low_edu ;?></td>    
  </tr>
  <tr>
    <td width="33%"><p>среднее образование</p></td>
    <td width="33%"><?php echo $p_vb_middle_edu;?></td>
    <td width="33%">&nbsp;</td>
    <td><?php echo $vbneyavka_middle_edu; ?></td>
    <td><?php echo $vb_middle_edu;?></td>    
  </tr>
  <tr>
    <td>высшее образование</td>
    <td><?php echo $p_vb_high_edu; ?></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><?php echo $vb_high_edu; ?></td>    
  </tr>
</table>

<h1>Вторая таблица</h1>
<table width="80%" border="1" >
  <tr>
    <td width="15%" align="center"><strong>факультет</strong></td>
    <td width="15%" align="center">&nbsp;</td>
    <td width="15%" align="center"><strong>еге</strong></td>
    <td width="15%" align="center"><strong>фцт</strong></td>
    <td width="15%" align="center"><strong>высшее обр</strong></td>
    <td width="15%" align="center"><strong>среднее обр</strong></td>
  </tr>
  <?php  foreach ($spravka as $row):?>
  <tr>
    <td width="15%" rowspan="2">
    <b>
	<?php 
		echo $listfacultets[$row['facultet_id']];
		echo ' ';
		echo $listprofessions[$row['profession_id']];
		
		echo ' ';
		echo $listlearningforms[$row['learningform']];
		
		echo ' ';
		echo $listlearningtypes[$row['learningtype']];
	?>
	</b>
	</td>
    <td width="15%"><b>зачислено</b></td>
    <td width="15%" align="center"><?php 	echo $row['en_ege'];	?></td>
    <td width="15%" align="center"><?php 	echo $row['en_fct'];	?></td>
    <td width="15%" align="center"><?php 	echo $row['en_high'];	?></td>
    <td width="15%" align="center"><?php 	echo $row['en_middle'];	?></td>
  </tr>
  <tr>
    <td width="15%"><b>подано</b></td>
    <td width="15%" align="center"><?php 	echo $row['p_ege'];	?></td>
    <td width="15%" align="center"><?php 	echo $row['p_fct'];	?></td>
    <td width="15%" align="center"><?php 	echo $row['p_high'];	?></td>
    <td width="15%" align="center"><?php 	echo $row['p_middle'];	?></td>
  </tr>
  <?php 
  endforeach;
  ?>
</table>